<%@page import="news.entity.Board"%>
<%@page import="news.biz.BoardBiz"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'boardList.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  添加新主题：<br/>
    <form action="admin/board.jsp" method="post">
    	主题名称：<input type="text" name="newboard" size="20"/>
    	<input type="submit" value="提交"/>
    </form>
    <table>
    	<tr>
    		<th>主题编号</th>
    		<th>主题名称</th>
    		<th>操作</th>
    	</tr>
    	
    	<%
    		BoardBiz boardBiz=new BoardBiz();
    		List<Board> boards=boardBiz.executeBoard();		//得到存储的所有board
    		for(int i=0;i<boards.size();i++){
    			Board board=boards.get(i);
    	%>
    		<tr>
    			<td><%=board.getBoardId() %></td>
    			<td><%=board.getBoardName() %></td>
    			<!--将boardid传过去-->
    			<td><a href="admin/editBoardById.jsp?boardId=<%=board.getBoardId() %>">编辑</a>|<a href="admin/deleteByBoardId.jsp?boardId=<%=board.getBoardId() %>">删除</a></td>
    		</tr>
    	<%} %>
    </table>
  </body>
</html>
